import { createRouter, createWebHistory } from 'vue-router'
import layout from '@/views/layout/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
      hidden: true
    },
    {
      path: '/',
      name: 'dashboard',
      component: layout,
      children:[
        {
          path:'/dashboard',
          component:() =>import('@/views/dashboard/index.vue'),
          meta:{
            title: '工作台',
          }
        },
        {
          path: '/ParkManagement',
          name: 'ParkManagement',
          children:[
            {
              path:'/ParkManagement/Buildingmanagement',
              component:() =>import('@/views/ParkManagement/Buildingmanagement/index.vue'),
              meta:{
                title: '楼宇管理',
               
              }
            },
            {
              path:'/ParkManagement/Companymanagement',
              component:() =>import('@/views/ParkManagement/Companymanagement/index.vue'),
              meta:{
                title: '企业管理',
              }
            },
          ]
        },
        {
          path: '/CarManagement',
          name: 'CarManagement',
          children:[
            {
              path:'/CarManagement/AreaManagement',
              component:() =>import('@/views/CarManagement/AreaManagement/index.vue'),
              meta:{
                title: '区域管理',
              }
            },
            {
              path:'/CarManagement/BillingRuleManagement',
              component:() =>import('@/views/CarManagement/BillingRuleManagement/index.vue'),
              meta:{
                title: '计费规则管理',
              }
            },
            {
              path:'/CarManagement/MonthCardManagement',
              component:() =>import('@/views/CarManagement/MonthCardManagement/index.vue'),
              meta:{
                title: '月卡管理',
               
              }
            },
            {
              path:'/CarManagement/ParkingFeeManagement',
              component:() =>import('@/views/CarManagement/ParkingFeeManagement/index.vue'),
              meta:{
                title: '停车缴费管理',
               
              }
            },
          ]
        },
        {
          path:'/PropertyFeeManagement',
          component:() =>import('@/views/PropertyFeeManagement/index.vue'),
          meta:{
            title: '物业费管理',
          }
        },
        {
          path: '/OneManagement',
          name: 'OneManagement',
          children:[
            {
              path:'/OneManagement/OneManagement',
              component:() =>import('@/views/OneManagement/OneManagement/index.vue'),
              meta:{
                title: '一体杆管理',
              }
            },
            {
              path:'/OneManagement/WarningRecord',
              component:() =>import('@/views/OneManagement/WarningRecord/index.vue'),
              meta:{
                title: '警告记录',
              }
            }
          ]
        },
        {
          path: '/systemManagement',
          name: 'systemManagement',
          children:[
            {
              path:'/systemManagement/EmployeeManagement',
              component:() =>import('@/views/systemManagement/EmployeeManagement/index.vue'),
              meta:{
                title: '员工管理',
              }
            },
            {
              path:'/systemManagement/RoleManagement',
              component:() =>import('@/views/systemManagement/RoleManagement/index.vue'),
              meta:{
                title: '角色管理',
              }
            }
          ]
        },
      ]
    },
  ] 
})

export default router
